#ifndef __MULTISCALESUBIMAGE_H__
#define __MULTISCALESUBIMAGE_H__

#include "point.h"

namespace DeepZoomImage
{
	class DeepZoomImageTileSource;

	class MultiScaleSubImage
	{
	public:
		MultiScaleSubImage ();
		MultiScaleSubImage(DeepZoomImageTileSource *source, int id, int n);
		virtual ~MultiScaleSubImage ();

		void ref();
		void unref();

		inline double GetAspectRatio () { return m_AspectRatio; }
		inline void SetAspectRatio (double ratio) { m_AspectRatio = ratio; }

		inline double GetOpacity () { return m_Opacity; }
		inline void SetOpacity (double ratio) { m_Opacity = ratio; }

		inline Point* GetViewportOrigin () { return &m_ViewportOrigin; }
		inline void SetViewportOrigin (Point* point) { m_ViewportOrigin = *point; }

		inline double GetViewportWidth () { return m_ViewportWidth; }
		inline void SetViewportWidth (double width) { m_ViewportWidth = width; }

		inline int GetZIndex () { return m_ZIndex; }
		inline void SetZIndex (int zindex) { m_ZIndex = zindex; }

		inline int GetId () {return id;}

		double GetViewportHeight ();

	public:
		int id, n;
		DeepZoomImageTileSource *source;

	protected:	
		double m_AspectRatio;
		double m_Opacity;
		Point m_ViewportOrigin;
		double m_ViewportWidth;	
		int m_ZIndex;

		//friend class MultiScaleImage;
		//friend void multi_scale_image_handle_parsed (void *userdata);

		gint32 refcount;
	};
};
#endif /* __MULTISCALESUBIMAGE_H__ */
